package com.ljz.service.impl;

import com.ljz.dao.SearchKeyDao;
import com.ljz.service.SearchKeyService;
import com.ljz.utils.SqlSessionFactoryUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class SearchKeyServiceImpl implements SearchKeyService {
    @Override
    public List<String> searchKey(String key) {
        SqlSession sqlSession = SqlSessionFactoryUtil.getSqlSession();
        SearchKeyDao searchKeyDao = sqlSession.getMapper(SearchKeyDao.class);
        key="%"+key+"%";
        System.out.println(key);
        return searchKeyDao.searchKey(key);
    }
}
